package com.example.demo;

import com.example.demo.demos.test.UseController;
import com.example.demo.demos.web.Controller_;
import com.example.demo.demos.web.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class DemoApplication {
    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(DemoApplication.class, args);
//        UseController bean = context.getBean(UseController.class);
//        bean.doController();
//        UseController bean2 = (UseController) context.getBean("useController");
//        bean2.doController();
//        UseController bean3 = context.getBean("useController", UseController.class);
//        bean3.doController();
//        System.out.println(bean);
//        System.out.println(bean2);
//        System.out.println(bean3);
//
//        User user1 = (User) context.getBean("user1");
//        User user2 = (User) context.getBean("user2");
//        System.out.println(user1);
//        System.out.println(user2);
//        Controller_ controller = context.getBean(Controller_.class);
//        controller.sayHi();
    }
}
